package com.shenghua.service.impl;

import com.shenghua.dao.mapper.AppFileMapper;
import com.shenghua.dao.model.AppFile;
import com.shenghua.dao.page.Page;
import com.shenghua.service.AppFileService;
import com.shenghua.utils.StringUtils;
import com.shenghua.utils.beans.Dto;
import com.shenghua.utils.beans.ErrorCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 文件业务
 * Created by Administrator on 2019/8/31.
 */
@Service
public class AppFileServiceImpl implements AppFileService {
    private Logger logger = LoggerFactory.getLogger(AppFileServiceImpl.class);
    @Autowired
    private AppFileMapper appFileMapper;

    @Override
    public Dto<AppFile> add(AppFile appFile) {
        Dto<AppFile> dto = new Dto<>();
        if(appFile != null && StringUtils.isNotBlank(appFile.getId())) {
            appFileMapper.insert(appFile);
            dto.ReturnSuccess(appFile, ErrorCode.SUCCESS);
            return dto;
        }
        dto.ReturnFail(null, ErrorCode.FAILURE);
        return dto;
    }

    @Override
    public Dto<AppFile> delete(AppFile appFile) {
        return null;
    }

    @Override
    public Dto<AppFile> edit(AppFile appFile) {
        return null;
    }

    @Override
    public Dto<List<AppFile>> query(Map map) {
        return null;
    }

    @Override
    public Integer count(Map map) {
        return null;
    }

    @Override
    public Dto<List<AppFile>> queryPage(Page page, Map map) {
        return null;
    }
}
